home *** CD-ROM | disk | FTP | other *** search
/ Ultimate Add-On's (Tournament Edition) / Cybercore Publishing - Ultimate Add-on's Tournament Edition.iso / tools / dforces / waxed15.txt < prev    next >
Text File  |  1995-08-21  |  14KB  |  317 lines

  1.  
  2.                              WAXEDIT.TXT v. 1.5
  3.                         _____________________________
  4.  
  5.  
  6. Author:
  7.  
  8.         TheRedDeth@aol.com -- me, Jonathan Wise
  9.  
  10. Thank yous:
  11.  
  12.         Cmdr Krud@aol.com -- the one who got me into Dark Forces editing.  He
  13.                 gave me many of the editing ideas I've used and many of the 
  14.                 ones I will use in later versions.  He is also my first beta-
  15.                 tester.  [NEW] I also need to thank him for a lot of help with
  16.                 logics.
  17.  
  18.         CarGoCo@aol.com -- did a lot of the programming and hacking of the WAX
  19.                 files that made all this possible.  He wrote WAXVIEW which is 
  20.                 included in this package.  [NEW] Thanx for the help with 
  21.                 logics.
  22.  
  23.         My Beta-Testers -- To write a program, it's gotta work, and you guys 
  24.                 tested it to make sure that it did.  Lots of thanx to:
  25.  
  26.                 Cmdr Krud@aol.com
  27.                 YODA DAGO@aol.com
  28.                 MSuther876@aol.com
  29.                 Driver9@aol.com
  30.                 Tyderian@aol.com
  31.  
  32.         Daron Stinnett and the rest of the DF crew -- without you guys, none 
  33.                 of this would have been possible.  Thanx for a great game (and
  34.                 hopefully many more).
  35.  
  36.         yborckmans@abcomp.linex.com -- Yves provided the editor that all of us
  37.                 love so much.  And he has give us the format for a compressed 
  38.                 FME, something none of this would have been possible without.
  39.                 [NEW] Yet another person who has helped with logics.
  40.  
  41.         Everyone I forgot to mention -- Thanx for your help.  Sorry I forgot
  42.                 to mention ya'.   
  43.  
  44. Copyright stuff:
  45.  
  46.    +------------------------------------------------------------------------+
  47.    | Dark Forces is (c) LucasArts Entertainment Company                     |
  48.    | DOOM        is (c) iD Software                                         |
  49.    |                                                                        |
  50.    | None of these have anything to do with these totally unofficial specs, |
  51.    | and shouldn't be bothered with them in any way.                        |
  52.    +------------------------------------------------------------------------+
  53.  
  54. I don't know why I mentioned DOOM in there.  Actually because I copyed this
  55. Copyright stuff directly out of Yves Borckmans DF_SPECS.DOC file.
  56.  
  57.  
  58. Other important last minute stuff:
  59.  
  60. Feel free to distribute this stuff all you want, as long as it's in its 
  61. original packaging.  No editing the exe's or this text file.  If you want 
  62. source code (C++ only), e-mail me, you have my address.  You can edit the 
  63. source code for your own use only.  You cannot distribute the edited source 
  64. code without my persmission.  So there.
  65.  
  66. WAX file structure:
  67.  
  68. typedef struct
  69. {
  70.         int             width;                // width in pixels
  71.         int             height;               // height in pixels
  72.         int             compression;          // compression type
  73.         int             size;                 // total size of compressed cell
  74.         dword           *aOffsets;            // column byte offset table
  75.         dword           pad1;
  76.         byte            data[];               // cell data stored in columns
  77. } Cell;
  78.  
  79. typedef struct
  80. {
  81.         fixed           xShift;               // x center point
  82.         fixed           yShift;               // y center point
  83.         int             flip;                 // 0 = none, 1 = h, 2 = v
  84.         Cell            *pCell;               // offset to cell
  85.         fixed           unitwidth;            // cell width in feet
  86.         fixed           unitheight;           // cell height in feet
  87.         dword           pad3;
  88.         dword           pad4;
  89. } Frame;
  90.  
  91. typedef struct
  92. {
  93.         dword           pad1;
  94.         dword           pad2;
  95.         dword           pad3;
  96.         dword           pad4;
  97.         Frame           *apFrame[32];         // Offsets to frames
  98. } Seq;
  99.  
  100. typedef struct
  101. {
  102.         fixed        worldWidth;    // real-world width in fixed point (16/16)
  103.         fixed        worldHeight;   // real-world height in fixed point (16/16)
  104.         int          frameRate;     // frames per second
  105.         dword        nFrames;       // number of frames in this wax
  106.         dword        pad2;
  107.         dword        pad3;
  108.         dword        pad4;
  109.         Seq          *apSeq[32];    // View table (Offsets)
  110. } Wax;
  111.  
  112. typedef struct
  113. {
  114.         fixed           version;         // File version control
  115.         int             nSeqs;           // Number of seqs
  116.         int             nFrames;         // Number of frames
  117.         int             nCells;          // Number of Cells
  118.         dword           xScale;          // x wax scale
  119.         dword           yScale;          // y wax scale
  120.         dword           extraLight;      // extra lighting
  121.         dword           pad4;
  122.         Wax             *apWax[32];      // Offset from file start to each wax
  123. } WaxHeader;
  124.  
  125.  
  126. This is fairly self explanatory (at least the comments are), but I'll go ahead
  127. and explain it anyway.  
  128.  
  129. note: padX = padding (always 0)
  130. *whatever = pointer to whatever
  131.  
  132. WaxHeader:
  133.  
  134.         xScale -- how the WAX gets bigger/smaller on the horizontal scale
  135.         yScale -- ditto, except on the vertical scale
  136.         extraLight -- how much light does the WAX give off
  137.  
  138. Wax:
  139.  
  140.         worldWidth -- what it says
  141.         worldHeight -- ditto
  142.  
  143. Seq:
  144.  
  145.         nothing important to explain here
  146.  
  147. Frame:
  148.  
  149.         xShift -- movement of center to left or right
  150.         yShift -- movement of center up or down
  151.         flip -- Like the 3DO flip.  [NEW] Very important, see section on it
  152.         unitWidth -- the width
  153.         unitHeight -- the height
  154.  
  155. Cell:  //This is what we extract and put back in
  156.  
  157.         width -- used to calculate size of Cell if compression == 0
  158.         height -- ditto
  159.         compression -- compression == 0 // not compressed
  160.                        compression == 1 // compressed
  161.         size -- used to calculate size of Cell if compression == 1
  162.         data -- the picture
  163.  
  164. Hope you now have a thorough understanding of a WAX file structure.
  165.  
  166.  
  167. What the programs do/don't do:
  168.  
  169.         WAX2FME  -- extracts multiple cells from a file
  170.                     eats about 500K, but I think you can manage that if you're
  171.                     able to play Dark Forces
  172.         FME2WAX  -- takes your edited cells and puts them back in the WAX
  173.                     requires that you have complete and unedited versions of 
  174.                     the WAX you are replacing in the directory of the program.
  175.                     [NEW] You do NOT need to make back-ups of the files you   
  176.                     are replacing.  FME2WAX 2.0 does it for you.
  177.         WAXTRACE -- this program traces through the WAX and shows you what the
  178.                     values of stuff are.  It's for you people who want to 
  179.                     create editors, not just edit.
  180.         WAXON    -- views a WAX.  While it may not be essential for editing, it
  181.                     sure is helpful.  Let me tell you, you don't want to edit 
  182.                     without it.
  183.                     [NEW] WAXON is included this time.
  184.  
  185. How to create a WAX:
  186.  
  187. This, of course, is the reason you downloaded this program, so I guess I might
  188. as well tell you how to use it.
  189.  
  190. VIEWING A WAX:
  191.         This is the easiest task.  Just use WAX2FME to extract the Cells, then
  192.         run Yves's FMEVIEW with the new fmes (included with DFUSE).  
  193.         [NEW] I'm not sure if you will be able to view your extracted FME's 
  194.         with FMEVIEW because header1 is not included in the WAX and is thus
  195.         not included in extracted FME's.
  196.  
  197. CREATING A NEW WAX:
  198.         To do this, you will need CarGoCo's FMECAD.  Use it to create a set of
  199.         new FME's to put in the WAX.  This must be the same number of WAXES as
  200.         there are in the WAX you are replacing.  Then you can use FME2WAX to 
  201.         create a brand spankin' new WAX.
  202.  
  203. EDITING A WAX:
  204.         To edit a WAX, use WAX2FME on the WAX.  Then use FMECAD to edit the 
  205.         resulting FME's.  You can use FME2WAX to put the new FME's back into 
  206.         a WAX.  You can only edit the uncompressed FME's inside the WAX, as 
  207.         there is no editor available to edit compressed FME's right now.
  208.         [NEW] because of reasons listed above, you can't edit until we know 
  209.         more about header1 of FME's.
  210.  
  211. [NEW] Flip:
  212.         Now that you know how to edit a WAX, I think it's a good time to bring
  213.         up Flip. If you examine the file structue, you'll notice that there is
  214.         a flip variable.  This can be used make WAX editing simpler and faster
  215.         -- but only if you know how to use it.  It will seem a little 
  216.         complicated at first, but it's worth it in the long term.  If you've 
  217.         done any 3DO editing, I believe it is similar (although I haven't done
  218.         any 3D0 editing myself).  Let me try and explain...
  219.  
  220.         If you view STORMFIN.WAX (it's best to CarGoCo's waxview, but you can
  221.         extract it if you want), you'll notice all the pictures have the storm
  222.         trooper facing in the same direction (I think it's left).  Now, if 
  223.         you've played the game, you should notice that the Storm Trooper can 
  224.         face left or right.  LA used the flip variable to make it appear as   
  225.         though the storm trooper is facing right.  You can use this too, in 
  226.         the same way.
  227.  
  228.         I haven't really studied the flip variable much at all.  I just know 
  229.         it is there.  I don't even know what any given value entails.  In my 
  230.         next version of WAXEDIT, I may include a flipping option inside 
  231.         FME2WAX, but for now, we'll have to improvise.  Since, by using 
  232.         FME2WAX, we replace a complete version of the WAX, we know that the 
  233.         flip value will remain intact (exactly as LA used it).  So all we need
  234.         to do is make our new waxes shown from the views that the Storm 
  235.         Trooper (or whatever) is shown.
  236.  
  237.         It's really not all that difficult.  If you didn't understand it or 
  238.         are having trouble, reread it.  If you're still having trouble, e-mail
  239.         me.
  240.  
  241. [NEW] A word on logics:
  242.  
  243.         I'm not exactly the expert on this, so you might be better off talking
  244.         to someone else about the subject.  Through a little bit of work on my
  245.         own, and a lot of help from friends, and a whole lot of listening to 
  246.         other people talk about it, I have managed to piece together a little
  247.         bit about logics.  I have to thank Cmdr Krud for really doing most of
  248.         the work for this section.
  249.  
  250.         If there's one thing that really holds us still in WAX editing, it's 
  251.         logics.  Logics prevent us from doing a lot of stuff we would really
  252.         like to do.  If only we could edit them...
  253.  
  254.         Well, before we can edit them, we have to know what they are, and 
  255.         that's a good portion of the problem.  We're not quite sure how 
  256.         they're stored, or where they're stored, or even how they're defined.
  257.         Let's work on the last one for now.
  258.  
  259.         As it turns out, logics (or at least parts of them) are stored inside
  260.         the WAX's.  This means that we can edit the logics to some degree 
  261.         (though indirectly) through the WAX's.  Flip is one example of this
  262.         (although it's not a very good one).  I think that the xShift and 
  263.         yShift variables are also examples, although I'm not quite sure right
  264.         now (testing is in progress).  What I think these variables are are 
  265.         definitions for how far an object can move in a single ray-trace.  If
  266.         this is true, it means that we can change how fast an enemy is, among
  267.         other things.
  268.  
  269.         Now that I've speculated about logics enough, let me speculate a 
  270.         little more about what they are.  It is possible that the above is not
  271.         actually part of the logic, but simply used by the logic.  I'm going 
  272.         to give a loose definition of logics, and let you decifer exactly what
  273.         they are.
  274.  
  275.         As far as I can tell, logics seem to be the Artificial Intelligence 
  276.         for the WAX's.  I think that they also tell the game engine when to 
  277.         load which frame of the wax, and when, and how far, to move the WAX
  278.         at any given time.
  279.  
  280.         That was pretty complicated.  Even more complicated than flip I 
  281.         suppose.  But, you don't need to read this again to edit WAX's.  It's
  282.         just here to kind of "get you prepared" for the future of WAX editing.
  283.         
  284.         If you formulate any opinions about WAX's, don't hesitate to send them
  285.         to me.  
  286.  
  287. What you should expect in later versions:
  288.  
  289.         WAX2FME may be reconfigured to eat less memory 
  290.         FME2WAX may be rewritten so it doesn't have that mean requirement
  291.         WAXTRACE may display more info, and explain what the info means 
  292.         WAXON it depends what CarGoCo wants to do with it
  293.         Expect expansion on the flip variable.  It can save you a lot of 
  294.                 editing time, if you know how to use it.
  295.  
  296. In v. 2.0
  297.  
  298.         You'll probably see a WAX<->BMP converter
  299.         Maybe an editor for compressed FME's
  300.         [NEW] LOTS of expansion on logics
  301.  
  302. In v. 3.0
  303.  
  304.         I can't be certain, but I think you may get a full WAX editor which
  305.         doesn't require you to create huge files.  Don't count on it for sure
  306.         though.  This is a long time in the future, and what happens then, 
  307.         depends on what happens now.
  308.  
  309. In v. 89.1136
  310.  
  311.         A Dark Forces 4 editor.  
  312.  
  313. Well, that's about it.  Enjoy your editing experience, but bear in mind, you
  314. can't edit compressed FME's until and editor for them comes out.  But the most
  315. important thing of all is: HAVE FUN!!!
  316.  
  317.